<%@ page import ="javax.naming.*"%>
<%@ page import ="javax.sql.*"%>
<%@ page import ="java.sql.*"%>
<%

javax.sql.DataSource dataSource = null;

try {
	
	//java.util.Properties params = new java.util.Properties();
	//params.put("v$session.program", "MyApp"); 
	InitialContext ctx = new InitialContext();    //Data Source Lookup
	

	dataSource = (javax.sql.DataSource) ctx.lookup("sanhak");
	//dataSource.setConnectionProperties(params);
} catch(NamingException ex) {
	ex.printStackTrace();
}

//Driver dbDriver = (Driver)Class.forName("jeus.jdbc.pool.Driver").newInstance();


java.sql.Connection connection = null;
java.sql.Statement stmt= null;
java.sql.ResultSet rs = null;
		
//String sql = " select lms_user.Searchcode('P','AA') from dual ";
String sql = "select sysdate from dual";
try {
	connection = dataSource.getConnection(); //DB Connection
	
	//connection = dbDriver.connect("jdbc:jeus:pool:kenn",null);
	//connection = org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(dataSource);
	stmt = connection.createStatement();
	//rs = stmt.executeQuery("select sysdate from dual");
	rs = stmt.executeQuery(sql);
	if(rs.next()) out.println(rs.getString(1));
} catch (java.sql.SQLException e) {
	e.printStackTrace();
}
rs.close();
stmt.close();
connection.close();


%>

